Field of the Invention
The present invention relates to multi-core devices, and in particular, relates to multi-thread management in a multi-core device.
Description of the Related Art
A scheduler, an arbiter on a modern Operating System (OS), decides the execution order of all runnable threads (or tasks). Conventionally, the scheduling rule of an OS is based upon priority. A thread with a higher priority cannot be preempted by a thread with a lower priority, and, the thread with a higher priority will be given a longer time slice to run in comparison with the lower priority threads.
As to an OS running on a multi-core device, the scheduler is capable of balancing all runnable threads onto the different central processing units periodically, which is called thread load balancing. Conventionally, the policy of thread load balancing is to balance the thread amounts between the different central processing units while the priorities of the threads have been taken into consideration. However, for thread load balancing based on the amount or the priority of threads, it cannot reflect actual loading of each thread (task) since different threads demand different central processing unit resources and it is not guaranteed that each thread is allocated to a proper central processing unit between the multiple central processing units. Also, for being critical problem, waiting until a next conventional thread load balancing timeframe arrives may be too late to resolve critical thread loading (also called thread critical performance condition in this invention). If occurring on a mobile device, the problem increases exponentially because a mobile device allows idle CPUs to be turned off in order to prolong battery life and only a decreased number of CPUs are available to share the workload.